﻿Type.registerNamespace("Sitefinity.Contrib.SocialWidgets.Facebook");

Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner = function (element) {
    Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner.initializeBase(this, [element]);
}


Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner.prototype = {
    initialize: function () {
        Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner.callBaseMethod(this, 'initialize');

    },
    dispose: function () {
        Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner.callBaseMethod(this, 'dispose');
    },
    refreshUI: function () {
        var data = this._propertyEditor.get_control();
        jQuery("#PID").val(data.PID);
        jQuery("#AlbumName").val(data.AlbumName);
		jQuery("#MaximumImages").val(data.MaximumImages);
		jQuery("#RotationTimerSeconds").val(data.RotationTimerSeconds);
		jQuery("#Width").val(data.Width);
		jQuery("#Height").val(data.Height);
    },
    applyChanges: function () {

        var controlData = this._propertyEditor.get_control();

        controlData.PID = jQuery("#PID").val();
        controlData.AlbumName = jQuery("#AlbumName").val();
		controlData.MaximumImages = jQuery("#MaximumImages").val();
		controlData.RotationTimerSeconds = jQuery("#RotationTimerSeconds").val();
		controlData.Width = jQuery("#Width").val();
		controlData.Height = jQuery("#Height").val();
    }
}

Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner.registerClass('Sitefinity.Contrib.SocialWidgets.Facebook.FacebookImageRotatorWidgetDesigner', Telerik.Sitefinity.Web.UI.ControlDesign.ControlDesignerBase);
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();